/*     */ package com.zimbra.cs.volume;
/*     */ 
/*     */ import com.zimbra.common.service.ServiceException;
/*     */ import com.zimbra.common.service.ServiceException.Argument;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public final class VolumeServiceException
/*     */   extends ServiceException
/*     */ {
/*     */   private static final long serialVersionUID = -3596326510079311719L;
/*     */   public static final String BAD_CURRVOL_CONFIG = "volume.BAD_CURRVOL_CONFIG";
/*     */   public static final String NO_SUCH_VOLUME = "volume.NO_SUCH_VOLUME";
/*     */   public static final String NO_SUCH_PATH = "volume.NO_SUCH_PATH";
/*     */   public static final String ALREADY_EXISTS = "volume.ALREADY_EXISTS";
/*     */   public static final String ID_OUT_OF_RANGE = "volume.ID_OUT_OF_RANGE";
/*     */   public static final String CANNOT_DELETE_VOLUME_IN_USE = "volume.CANNOT_DELETE_VOLUME_IN_USE";
/*     */   public static final String WRONG_TYPE_CURRVOL = "volume.WRONG_TYPE_CURRVOL";
/*     */   public static final String CANNOT_DELETE_CURRVOL = "volume.CANNOT_DELETE_CURRVOL";
/*     */   public static final String CANNOT_CHANGE_TYPE_OF_CURRVOL = "volume.CANNOT_CHANGE_TYPE_OF_CURRVOL";
/*     */   public static final String INVALID_REQUEST = "volume.INVALID_REQUEST";
/*     */   public static final String NOT_ABSOLUTE_PATH = "volume.NOT_ABSOLUTE_PATH";
/*     */   public static final String SUBDIR_OF_ANOTHER_VOLUME = "volume.SUBDIR_OF_ANOTHER_VOLUME";
/*     */   public static final String INVALID_METADATA = "volume.INVALID_METADATA";
/*     */   
/*     */   private VolumeServiceException(String message, String code, boolean isReceiversFault)
/*     */   {
/*  40 */     super(message, code, isReceiversFault, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   VolumeServiceException(String message, String code, boolean isReceiversFault, Throwable cause) {
/*  44 */     super(message, code, isReceiversFault, cause, new ServiceException.Argument[0]);
/*     */   }
/*     */   
/*     */   public static VolumeServiceException BAD_CURRVOL_CONFIG(String msg) {
/*  48 */     return new VolumeServiceException("invalid current volumes config: " + msg, "volume.BAD_CURRVOL_CONFIG", true, null);
/*     */   }
/*     */   
/*     */   public static VolumeServiceException NO_SUCH_VOLUME(int id)
/*     */   {
/*  53 */     return new VolumeServiceException("no such volume: " + id, "volume.NO_SUCH_VOLUME", false, null);
/*     */   }
/*     */   
/*     */   public static VolumeServiceException NO_SUCH_PATH(String path) {
/*  57 */     return new VolumeServiceException("directory does not exist or is not writable: " + path, "volume.NO_SUCH_PATH", false, null);
/*     */   }
/*     */   
/*     */   public static VolumeServiceException ALREADY_EXISTS(int id, String name, String path, Throwable t)
/*     */   {
/*  62 */     return new VolumeServiceException("volume with the same id, name, or path already exists: (id=" + id + ", name=\"" + name + "\", path=" + path + ")", "volume.ALREADY_EXISTS", false, t);
/*     */   }
/*     */   
/*     */   public static VolumeServiceException ID_OUT_OF_RANGE(int id)
/*     */   {
/*  67 */     return new VolumeServiceException("id " + id + " is out of range [0, " + 255 + "]", "volume.ID_OUT_OF_RANGE", false, null);
/*     */   }
/*     */   
/*     */   public static VolumeServiceException CANNOT_DELETE_VOLUME_IN_USE(int id, Throwable t)
/*     */   {
/*  72 */     return new VolumeServiceException("volume id " + id + " is in use by one or more mailboxes and cannot be deleted", "volume.CANNOT_DELETE_VOLUME_IN_USE", false, t);
/*     */   }
/*     */   
/*     */   public static VolumeServiceException CANNOT_DELETE_CURRVOL(int id, String volType)
/*     */   {
/*  77 */     return new VolumeServiceException("volume " + id + " cannot be deleted because it is a current volume: " + volType, "volume.CANNOT_DELETE_CURRVOL", false, null);
/*     */   }
/*     */   
/*     */   public static VolumeServiceException WRONG_TYPE_CURRVOL(int id, short currVolType)
/*     */   {
/*  82 */     return new VolumeServiceException("volume " + id + " cannot be used as current volume of type " + currVolType, "volume.WRONG_TYPE_CURRVOL", false, null);
/*     */   }
/*     */   
/*     */   public static VolumeServiceException CANNOT_CHANGE_TYPE_OF_CURRVOL(Volume vol, short newType)
/*     */   {
/*  87 */     return new VolumeServiceException("cannot change type of volume \"" + vol.getName() + "\" (id=" + vol.getId() + ") to " + newType + " because it is the current " + vol.getType() + " volume", "volume.CANNOT_CHANGE_TYPE_OF_CURRVOL", false, null);
/*     */   }
/*     */   
/*     */ 
/*     */   public static VolumeServiceException INVALID_REQUEST(String msg)
/*     */   {
/*  93 */     return new VolumeServiceException("invalid request: " + msg, "volume.INVALID_REQUEST", false, null);
/*     */   }
/*     */   
/*     */   public static VolumeServiceException NOT_ABSOLUTE_PATH(String path) {
/*  97 */     return new VolumeServiceException("\"" + path + "\" is not an absolute path", "volume.NOT_ABSOLUTE_PATH", false, null);
/*     */   }
/*     */   
/*     */   public static VolumeServiceException SUBDIR_OF_ANOTHER_VOLUME(String path, Volume anotherVol)
/*     */   {
/* 102 */     return new VolumeServiceException("the path \"" + path + "\" is a subdirectory of another volume (id=" + anotherVol.getId() + ", path=" + anotherVol.getRootPath() + ")", "volume.SUBDIR_OF_ANOTHER_VOLUME", false, null);
/*     */   }
/*     */   
/*     */ 
/*     */   public static VolumeServiceException INVALID_METADATA(Throwable cause)
/*     */   {
/* 108 */     return new VolumeServiceException("could not decode metadata", "volume.INVALID_METADATA", true, cause);
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/volume/VolumeServiceException.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */